package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.GoodsBuy;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.GoodsBuyManager;

public class GoodsBuyManagerImpl extends AbstractManager implements GoodsBuyManager {

	@Override
	public void addGoodsBuy(GoodsBuy goodsBuy) {

		getHibernateTemplate().save(goodsBuy);
	}

	@Override
	public void delGoodsBuyById(String id) {

		getHibernateTemplate().delete(findGoodsBuyById(id));
	}

	@Override
	public PagerModel findAllGoodsBuys() {

		return searchPaginate("select gb from GoodsBuy gb");
	}

	@Override
	public GoodsBuy findGoodsBuyById(String id) {

		return (GoodsBuy)getHibernateTemplate().load(GoodsBuy.class, id);
	}

	@Override
	public void updateGoodsBuy(GoodsBuy goodsBuy) {

		getHibernateTemplate().update(goodsBuy);
	}

}
